#ifndef __XrdDMSimFileCatalog_H__
#define __XrdDMSimFileCatalog_H__
#define XRDDMSIM_MAX_SITES 10
#define XRDDMSIM_MAX_FILES 1000

#include <iostream>
#include <stdlib.h>
using namespace std;

#include "XrdDMSimSiteInfo.hh"
#include "XrdDMSimFileInfo.hh"

class XrdDMSimulator;

class XrdDMSimFileCatalog
{
  public:
    XrdDMSimFileCatalog();
    ~XrdDMSimFileCatalog();

    void              Generate(XrdDMSimulator* sim, int numfiles, int filesPerSite);
    void              Print();

    void              SetTimeSeed() {srand(time(NULL)); };

    int               GetNumerOfSites() { return fMaxSites;}
    int               GetNumerOfFiles() { return fMaxFiles;}

    int               GetFileIndex(string file);
    int               GetSiteIndex(string site,int index=0);

    XrdDMSimSiteInfo *GetSite(int indexSite,int indexFile) { return &fSites[indexSite][indexFile]; };
    XrdDMSimFileInfo *GetFile(int indexSite,int indexFile) { return &fFiles[indexSite][indexFile]; };
    bool              IsFileStaged(int indexSite,int indexFile) { return fIsFileStaged[indexSite][indexFile]; };
    void              SetNumberOfFilesNotStaged(string siteName);

  private:
    XrdDMSimSiteInfo  fSites[XRDDMSIM_MAX_SITES][XRDDMSIM_MAX_FILES];
    XrdDMSimFileInfo  fFiles[XRDDMSIM_MAX_SITES][XRDDMSIM_MAX_FILES];
    bool              fIsFileStaged[XRDDMSIM_MAX_SITES][XRDDMSIM_MAX_FILES];
    int               fMaxSites;
    int               fMaxFiles;

};

#endif // __XrdDMSimFileCatalog_H__
